// AUTO GENERATED CODE!
// CODE GENERATOR WILL NOT PRESERVE MANUAL CHANGES TO THIS CODE!
// 

// MIT License (MIT)
// 
// Copyright (c) 2014 K Ercan Turkarslan
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
// 


using System;
// ReSharper disable once RedundantUsingDirective 
using Mios.Generated.ServiceFiles;

namespace Mios.Generated.DeviceFiles
{
    // Generated from D_WindowCovering1.xml
    
    public class WindowCovering1 : MiosDevice
    {
        #region Inherited ServiceNodes
        
        public EnergyMetering1Service SEnergyMetering1 { get; private set; }
        
        public HaDevice1Service SHaDevice1 { get; private set; }
        
        public Dimming1Service SDimming1 { get; private set; }
        
        public SwitchPower1Service SSwitchPower1 { get; private set; }
        
        public WindowCovering1Service SWindowCovering1 { get; private set; }
        
        #region Method InitializeInheritedServices(MiosEngine engine, UInt32 deviceId)
        private void InitializeInheritedServices(MiosEngine engine, UInt32 deviceId)
        {
            SEnergyMetering1 = new EnergyMetering1Service(engine, deviceId, "urn:micasaverde-com:serviceId:EnergyMetering1");
            SHaDevice1 = new HaDevice1Service(engine, deviceId, "urn:micasaverde-com:serviceId:HaDevice1");
            SDimming1 = new Dimming1Service(engine, deviceId, "urn:upnp-org:serviceId:Dimming1");
            SSwitchPower1 = new SwitchPower1Service(engine, deviceId, "urn:upnp-org:serviceId:SwitchPower1");
            SWindowCovering1 = new WindowCovering1Service(engine, deviceId, "urn:upnp-org:serviceId:WindowCovering1");
        }
        #endregion Method InitializeInheritedServices
        
        #endregion Inherited ServiceNodes
        
        #region Method SetVariable(String serviceId, String variable, String value) : Boolean;
        internal override Boolean SetVariable(String serviceId, String variable, String value)
        {
            switch(serviceId)
            {
                case "urn:micasaverde-com:serviceId:EnergyMetering1":
                    return SEnergyMetering1.SetVariable(variable, value);
                case "urn:micasaverde-com:serviceId:HaDevice1":
                    return SHaDevice1.SetVariable(variable, value);
                case "urn:upnp-org:serviceId:Dimming1":
                    return SDimming1.SetVariable(variable, value);
                case "urn:upnp-org:serviceId:SwitchPower1":
                    return SSwitchPower1.SetVariable(variable, value);
                case "urn:upnp-org:serviceId:WindowCovering1":
                    return SWindowCovering1.SetVariable(variable, value);
                case "urn:micasaverde-com:serviceId:ZWaveDevice1":
                    return SZWaveDevice1.SetVariable(variable, value);
                
                default:
                    return false;
            }
        }
        #endregion Method SetVariable
        
        #region Method SetShortCode(String shortCode, String value) : Boolean;
        internal override Boolean SetShortCode(String shortCode, String value)
        {
            switch(shortCode)
            {
                case "kwh":
                    return SetVariable("urn:micasaverde-com:serviceId:EnergyMetering1", "KWH", value);
                case "pulse":
                    return SetVariable("urn:micasaverde-com:serviceId:EnergyMetering1", "Pulse", value);
                case "watts":
                    return SetVariable("urn:micasaverde-com:serviceId:EnergyMetering1", "Watts", value);
                case "wholehouse":
                    return SetVariable("urn:micasaverde-com:serviceId:EnergyMetering1", "WholeHouse", value);
                case "batterylevel":
                    return SetVariable("urn:micasaverde-com:serviceId:HaDevice1", "BatteryLevel", value);
                case "level":
                    return SetVariable("urn:upnp-org:serviceId:Dimming1", "LoadLevelStatus", value);
                case "status":
                    return SetVariable("urn:upnp-org:serviceId:SwitchPower1", "Status", value);
                default:
                    return false;
            }
        }
        #endregion Method SetShortCode
        
        #region Constructor(s)
        public WindowCovering1(MiosEngine engine, UInt32 deviceId)
            : base(engine, deviceId)
        {
            InitializeInheritedServices(engine, deviceId);
        } //End Constructor
        
        #if USE_SDATA || USE_USERDATA
        public WindowCovering1(MiosEngine engine, UInt32 deviceId, String name, String localUdn, String deviceType, MiosRoom room)
            : base(engine, deviceId, name, localUdn, deviceType, room)
        {
            InitializeInheritedServices(engine, deviceId);
        } //End Constructor
        #endif
        #endregion Constructor(s)
        
    } //End of class
} //End of Namespace

